//
//  ZhuHuDiaoChaoViewController.m
//  tangshantongjiAPP
//
//  Created by yuntai on 2018/4/23.
//  Copyright © 2018年 yuntai. All rights reserved.
//

#import "ZhuHuDiaoChaoViewController.h"
#import "UIButton+TextImage.h"
#import "ZaiXianDiaoChaViewController.h"
#import "WenJianTongZhiViewController.h"

@interface ZhuHuDiaoChaoViewController ()
@property (weak, nonatomic) IBOutlet UILabel *titlelabel;
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *btnArrays;

@end

@implementation ZhuHuDiaoChaoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenBoundWidth,   kNavigationHeight-44)];
    topView.backgroundColor = kNavigationColor;
    [self.view addSubview:topView];
    self.titlelabel.text = @"住户调查";
    NSArray *iamgeNameArray = [NSArray arrayWithObjects:@"ic_wenxintishi",@"ic_wenjiantongzhi",@"ic_dianzijizhang",@"ic_zaixiandiaocha", nil];
    
    [self.btnArrays enumerateObjectsUsingBlock:^(UIButton *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        

        if (IS_IPHONE5) {
            obj.titleLabel.font = [UIFont systemFontOfSize:14];
        }
        obj.layer.cornerRadius = 2.2f;
        obj.layer.masksToBounds = YES;
        [obj setImage:[UIImage imageNamed:iamgeNameArray[idx]] forState:UIControlStateNormal];
    }];
    
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    //    self.navigationController.navigationBar.hidden = YES;
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (IBAction)backAction:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)btnActions:(UIButton *)sender {
    
    switch (sender.tag) {
            case 0:
        {
            ZaiXianDiaoChaViewController *vc = [[ZaiXianDiaoChaViewController alloc]init];
            vc.type = WenXinTishi;
            vc.title = @"温馨提示";
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
            
            case 1:
        {
            WenJianTongZhiViewController *vc = [[WenJianTongZhiViewController alloc]init];
            vc.title = @"文件通知";
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
            
            case 2:
        {
            [HUDManager showWarningWithText:@"请先安装记账宝!"];
        }
            break;
            
            case 3:
        {
            ZaiXianDiaoChaViewController *vc = [[ZaiXianDiaoChaViewController alloc]init];
            vc.type = ZhuHuDiaoCha;
            vc.title = @"在线调查";
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
    }
    
}

@end
